<div class="widget-box dataTables_wrapper">
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
	'itemsCssClass'=>'table table-bordered table-striped table-hover',
	'summaryCssClass'=>'summary widget-title',
	'cssFile'=> Yii::app()->request->baseUrl.WWWROOT_BACKEND."/css/gridview/styles.css",
	'htmlOptions'=>array('class'=>'widget-content nopadding grid-view'),
	'columns'=>array(
		array(
			'name' => 'id',
			'type'=>'raw',
			'value' => 'CHtml::link(CHtml::encode($data->id),array("admin/update","id"=>$data->id))',
		),
		array(
			'name' => 'username',
			'type'=>'raw',
			'value' => 'CHtml::link(CHtml::encode($data->username),array("admin/view","id"=>$data->id))',
		),
		array(
			'name'=>'email',
			'type'=>'raw',
			'value'=>'CHtml::link(CHtml::encode($data->email), "mailto:".$data->email)',
		),
		array(
			'name' => 'createtime',
			'value' => 'date("d.m.Y H:i:s",$data->createtime)',
		),
		array(
			'name' => 'lastvisit',
			'value' => '(($data->lastvisit)?date("d.m.Y H:i:s",$data->lastvisit):UserModule::t("Not visited"))',
		),
		array(
			'name' => 'country_id',
			'type'=>'raw',
			'value' => 'Country::model()->findbyPk($data->country_id)',
		),
		array(
			'name'=>'status',
			'value'=>'User::itemAlias("UserStatus",$data->status)',
		),
		/*
		array(
			'name'=>'superuser',
			'value'=>'User::itemAlias("AdminStatus",$data->superuser)',
		),
		*/
		array(
			'header'=>'Roles',
			'filter'=>CHtml::activeDropDownList($model,'roles',$model->getRolesAsListData(), array('empty'=>'')),
			'name' => 'roles',
			'value' => '$data->getUserRoleName($data->id)',
		),
		array(
			'class'=>'CButtonColumn',
			'header'=>'Actions',
		),
	),
)); 

?>
<div class="fg-toolbar widget-content">
	<?php echo CHtml::link('Create a new user', array('/user/admin/create'), array('class'=>'btn')); ?>
</div>
</div>